<?php
  require_once('nav.php');
?>
        <div class="col-sm-9 col-md-10">
          <?php
            //编写sql语句
            $sql = 'select * from videotype';
            //echo $sql.'<br/>';  
            $result = fetch_array($sql);
          ?>
          <center><h3>视频类别列表</h3></center>
         <table class="table table-hover"> 
         <tr>
           <th>编号</th>
           <th>视频类别</th>   

           <th>操作</th>
         </tr>

         <?php
          foreach ($result as $row) {
           echo '<tr>';
           echo '<td>'.$row['tid'].'</td>';
           echo '<td>'.$row['typename'].'</td>';  
           
            echo '<td><a href="vt-EditForm.php?id='.$row['tid'].' ">修改</a> | 
   <a href="vtDelete.php?id='.$row['tid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
           echo '</tr>';  
          }
          echo '</table>';  
          $totalrows = count($result);
          echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";   
         ?>

        </div>
      <?php
        require_once('footer.php');
      ?>